<?php

use think\migration\Migrator;


class AlterCouponBrandModifly extends Migrator
{
    public function up()
    {
$sql = <<<SQL
      ALTER TABLE `coupon_brand` ADD COLUMN `act_id`  int(11) NOT NULL  DEFAULT '0' COMMENT '活动id';
      ALTER TABLE `coupon_brand` ADD COLUMN `act_name`  varchar(100) NOT NULL  DEFAULT '' COMMENT '原始名称';
      ALTER TABLE `coupon_brand` ADD COLUMN `belong`  varchar(30) NOT NULL  DEFAULT 'huiChong' COMMENT '所属';
      ALTER TABLE `coupon_brand` ADD COLUMN `type`  varchar(30) NOT NULL   DEFAULT '' COMMENT '类型比如Food、Travel';
      ALTER TABLE `coupon_brand` ADD COLUMN `serv_type`  tinyint(3) NOT NULL  DEFAULT '0' COMMENT '服务类型id';
      ALTER TABLE `coupon_brand` ADD COLUMN `ext_data` json DEFAULT NULL COMMENT '扩展信息';
      ALTER TABLE `coupon_brand` ADD COLUMN `icon`  varchar (200) NOT NULL  DEFAULT '' COMMENT '权益模板图片';
      ALTER TABLE `coupon_brand` ADD COLUMN `subtitle_type`  tinyint (3) NOT NULL  DEFAULT '1' COMMENT '副标题类型1显示折扣 2显示自定义';
SQL;
        $this->execute($sql);

    }

    public function down()
    {
        $this->table('coupon_brand')->removeColumn('act_id')
                                              ->removeColumn('act_name')
                                              ->removeColumn('belong')
                                              ->removeColumn('type')
                                              ->removeColumn('subtitle_type')
                                              ->removeColumn('icon')
                                              ->removeColumn('ext_data')
                                              ->removeColumn('serv_type');
    }
}
